<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8" />
    <title>产品类型信息查询 - 产品报价管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
    <meta content="" name="author" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="../assets/images/favicon.ico">

    <!-- App css -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../assets/css/jquery-ui.min.css" rel="stylesheet">
    <link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" />
    <link href="../assets/css/metisMenu.min.css" rel="stylesheet" type="text/css" />
    <link href="../assets/css/app.min.css" rel="stylesheet" type="text/css" />

</head>

<body class="dark-topbar dark-sidenav">

<!-- Top Bar Start -->
<div th:replace="~{/common/top::top}"></div>

<!-- Top Bar End -->


<!-- Left Sidenav -->
<div th:replace="~{/common/left-side-nav::left-side-nav}"></div>


<div class="page-wrapper">
    <!-- Page Content-->
    <div class="page-content">

        <div class="container-fluid">
            <!-- Page-Title -->
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title-box">
                        <h4 class="page-title">产品类型信息查询</h4>
                    </div>
                    <!--end page-title-box-->
                </div>
                <!--end col-->
            </div>
            <!-- end page title end breadcrumb -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <form class="form-inline mb-3"
                                  th:action="@{/product/produce_type_list}" method="get">
                                <input type="hidden" name="pageSize" th:value="${page.pageSize}"/>
                                <div class="form-group">
                                    <label class="sr-only" for="keyword">搜索</label>
                                    <input type="text" class="form-control" id="keyword"
                                           th:value="${param.keyword}" name="keyword" placeholder="请输入关键字">
                                </div>

                                <button type="submit" class="btn btn-gradient-primary ml-4">搜索</button>
                                <button id="clearBtn"  type="button" class="btn btn-gradient-danger ml-4">清除</button>
                            </form>
                            <div class="table-responsive">
                                <table class="table table-striped mb-0">
                                    <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>产品类型id</th>
                                        <th>产品类型名称</th>
<!--                                        <th>联系地址</th>-->
<!--                                        <th>联系人</th>-->
<!--                                        <th>其他信息</th>-->
                                        <th th:if="${session.user.level=='管理员'}">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody th:remove="all-but-first">
                                    <tr th:each="productType : ${page.list}">
                                        <td th:text="${productTypeStat.count}"></td>
                                        <td th:text="${productType.id}"></td>
                                        <td th:text="${productType.name}"></td>
<!--                                        <td th:text="${customer.address}"></td>-->
<!--                                        <td th:text="${customer.relName}"></td>-->
<!--                                        <td th:text="${customer.other}"></td>-->


                                        <td th:if="${session.user.level=='管理员'}">
                                            <a th:href="@{/product/produce_type_modify(id=${productType.id},pageSize=${page.pageSize},pageNum=${page.pageNum},keyword=${param.keyword})}" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a th:href="@{/product/produce_type_remove(id=${productType.id},pageSize=${page.pageSize},pageNum=${page.pageNum},keyword=${param.keyword})}"><i
                                                    class="fas fa-trash-alt text-danger font-16 removeBtn"></i></a>
                                        </td>


                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>平原科技</td>
                                        <td>020-98786754</td>
                                        <td>北京昌平</td>
                                        <td>张兵</td>
                                        <td>公司简介</td>
                                        <td>
                                            <a href="#" class="mr-2"><i
                                                    class="fas fa-edit text-info font-16"></i></a>
                                            <a href="#"><i
                                                    class="fas fa-trash-alt text-danger font-16"></i></a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <!--end /table-->

                            </div>
                            <!--end /tableresponsive-->

                            <div class="row mt-3">
                                <div class="col-sm-6">
											<span class="align-middle">
												共<span th:text="${page.total}"></span>条，每页显示
												<select id="page-size-select" th:remove="all-but-first">
													<option th:each="pageSize : ${#numbers.sequence(5,30,5)}"
                                                            th:text="${pageSize}"
                                                            th:selected="${pageSize}==${page.pageSize}"></option>
													<option>5</option>
													<option>10</option>
													<option>15</option>
												</select>条数据
											</span>
                                </div>
                                <div class="col-sm-6">
                                    <nav aria-label="Page navigation example">
                                        <ul class="pagination justify-content-end">
                                            <li th:class="${page.isFirstPage}?'page-item disabled':'page-item'">
                                                <a class="page-link" th:href="@{/product/produce_type_list(pageNum=${page.pageNum}-1,pageSize=${page.pageSize},keyword=${param.keyword})}">上一页</a>
                                            </li>
                                            <li th:class="${pageNum}==${page.pageNum}?'page-item active':'page-item'" th:each="pageNum:${#numbers.sequence(1,page.pages,1)}" >
                                                <a class="page-link" th:text="${pageNum}"
                                                   th:href="@{/product/produce_type_list(pageNum=${pageNum},pageSize=${page.pageSize},keyword=${param.keyword})}" >1</a>
                                            </li>

                                            <li th:class="${page.isLastPage}?'page-item disabled':'page-item'">
                                                <a class="page-link" th:href="@{/product/produce_type_list(pageNum=${page.pageNum}+1,pageSize=${page.pageSize},keyword=${param.keyword})}">下一页</a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>

                            </div>

                        </div>
                        <!--end card-body-->
                    </div>
                    <!--end card-->
                </div> <!-- end col -->
            </div> <!-- end row -->

        </div><!-- container -->
        <!--end footer-->
    </div>
    <!-- end page content -->
</div>
<!-- end page-wrapper -->




<!-- jQuery  -->
<script src="../assets/js/jquery.min.js"></script>
<script src="../assets/js/bootstrap.bundle.min.js"></script>
<script src="../assets/js/metismenu.min.js"></script>
<script src="../assets/js/waves.js"></script>
<script src="../assets/js/feather.min.js"></script>
<script src="../assets/js/jquery.slimscroll.min.js"></script>
<script src="../assets/js/jquery-ui.min.js"></script>

<!-- App js -->
<script src="../assets/js/app.js"></script>

<script>
    $('#page-size-select').change(function (event) {
        var pageSize=$(this).val();
        var keyword=$('#keyword').val()
        window.location='/product/produce_type_list?pageNum=1&pageSize='+pageSize+'&keyword='+keyword;
    })

    $('#clearBtn').click(function (event) {
        var pageSize=$('#page-size-select').val();
        window.location='/product/produce_type_list?pageNum=1&pageSize='+pageSize;


    })

    $('.removeBtn').click(function (event) {

        return confirm('是否要删除该条记录？');

    })
</script>

</body>

</html>
